{extend name="base/form_base" /}
{block name="style"}
<style type="text/css">

</style>
{/block}
{block name="content"}
<div class="layui-fluid">
<form class="layui-form" id='edit_form' onsubmit="return false">

            <input type="hidden" name="id" value="{$data.id ?? ''}">
        

            <input type="hidden" name="type" value="1">
            <div class="layui-form-item">
                <label class="layui-form-label">申请金额：</label>
                <div class="layui-input-inline">
                    <input type="text" name="amount" autocomplete="off" class="layui-input" id='amount' value="{$data.amount ?? '1'}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">申请数量：</label>
                <div class="layui-input-inline">
                    <input type="text" name="num" autocomplete="off" class="layui-input" id='num' value="{$data.num ?? '1'}">
                </div>
            </div>
          </div>
        
            <div class="layui-form-item">
                <div class="layui-input-inline" style="width: 80px">
                  <button class="layui-btn" onclick="ajax()" lay-filter="formDemo">确定</button>
                </div>
            </div>

</form>
</div>  
{/block}
{block name="script"}
<script type="text/javascript">
  function ajax(){
    var post_data = $('#edit_form').serialize();
    $.ajax({
            url:"{:url('admin/reward/sqHb')}",
            type:"POST",
            data:post_data,
            success:function(ret){
                if (ret.code == 0) {
                  layer.msg('操作成功');
                  parent.$(".layui-laypage-btn")[0].click();
                  parent.location.reload();
                }
                if (ret.code == 1) {
                    layer.msg(ret.msg);
                }
            }
        });
  }
</script> 
{/block}